package com.woniuxy.service;

import com.woniuxy.entity.User;
import com.woniuxy.utils.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@FeignClient(name = "user")
public interface UserService {
    @GetMapping("/user/test")
    public String test();

    @GetMapping("/user/all")
    public List<User> all();

    @GetMapping("/user/get")
    public User getUser(@RequestParam(name = "id") int id);

    //鉴权方法
    @GetMapping("/user/hasPerms/{account}/{perms}")
    ResponseResult hasPerms(@PathVariable("account") String account, @PathVariable("perms") String perms);

    //    席磊添加
    @GetMapping("/user/getusername")
    public User getUser(@RequestParam(name = "username") String username);
}
